package com.hkts.naturalgasauthentication.base.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.hkts.naturalgasauthentication.common.constant.CommonConstant;
import lombok.Data;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.List;

@Data
@Entity
@Table(name = "department")
public class Department extends ManagementBaseEntity{
    private static final long serialVersionUID = 1L;

    @Column(name = "title")
    private String title;

    @Column(name = "parent_id")
    private String parentId;

    @Column(name = "is_parent")
    private Boolean isParent = false;

    @Column(precision = 10, scale = 2)
    private BigDecimal sortOrder;

    @Column(name = "status")
    private Integer status = CommonConstant.STATUS_NORMAL;

    @Transient
    @TableField(exist=false)
    private String parentTitle;

    @Transient
    @TableField(exist=false)
    private List<String> mainHeader;

    @Transient
    @TableField(exist=false)
    private List<String> viceHeader;

    @Transient
    private List<Department> childrenDepartment;
}
